﻿
@{
    ViewBag.Title = "Login";
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录界面</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/login/style.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/jquery.form.js"></script>   
    <script src="~/Scripts/layer/mobile/layer.js"></script>
</head>

<body style="        background: url('../../Content/login/images/bg.jpg') no-repeat;       ">

    <div class="container wrap1" style="height:450px;">
        <h2 class="mg-b20 text-center">XXX后台管理系统</h2>
        <div class="col-sm-8 col-md-5 center-auto pd-sm-50 pd-xs-20 main_content">
            <p class="text-center font16">用户登录</p>
            <form action="~/Login/UserLogin" id="formLogin" method="post">
                <div class="form-group mg-t20">
                    <i class="icon-user icon_font"></i>
                    <input type="text" class="login_input"  name="userName" id="userName" placeholder="请输入用户名"  required style="color:white"/>
                </div>
                <div class="form-group mg-t20">
                    <i class="icon-lock icon_font"></i>
                    <input type="password" class="login_input" name="password" id="password" placeholder="请输入密码" style="color:white" required />
                </div>
                <div class="checkbox mg-b25">
                    <label>
                        <input type="checkbox" />记住我的登录信息
                    </label>
                </div>
                <button style="submit" class="login_btn">登 录</button>
            </form>
        </div><!--row end-->
    </div><!--container end-->
    <script type="text/javascript">
        $(document).ready(function () {

            var optionsNew = {
                beforeSubmit: function () {
                    layer.open({ type: 2 });
                },              
                success: function (data) {
                    if (data.Success == true) {
                      //  layer.open({ content: '登录成功，2秒自动跳转', style: 'color:black; ',time:2 });
                        window.location.href = data.Data + "?id=" + 10000 * Math.random();
                    } else {
                        layer.open({ content: data.Data,style: 'color:black; ', time: 2 });
                    }
                },
                error: function (data) {
                    alert(JSON.stringify(data));
                },
                type: "post",
                clearForm: false,
                timeout: 100000
            };

            $("#formLogin").submit(function () {
                $("#formLogin").ajaxSubmit(optionsNew);// type="button"
                return false;
            });
            
            
        });
    </script>
</body>
</html>
